<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>map和set</title>
	<!--<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>-->
</head>
<body>
<script>
	//javaScript定义一个map
	//初始化map需要一个二维数组
	var map = new Map([['小明',90],['小红',88],[3,87]]);
	var xiaoming = map.get("小明");
	var key3 = map.get(3);
	console.log("xiaoming:" + xiaoming + ",key3:" + key3)
	//
	var hasXiaoming = map.has("小明");
	console.log("是否有小明:" + hasXiaoming);
	//添加国籍
	map.set("country","中国");
	//删除小红
	map.delete("小红");
	map.set("country","日本");
	console.log(map)

	//set:初始化set需要一维数组
	var set = new Set([1,2,3,4,5]);
	set.add(5);
	console.log(set)
	set.delete(5);
	console.log(set);
</script>
</body>
</html>